package com.example.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.MimeType;

import java.nio.charset.Charset;

/**
 * Created by ykbboom on 2017/2/22.
 */
@ConfigurationProperties("spring.thymeleaf")
public class ThymeleafProperties {
//    private static final Charset DEFAULT_ENCODING = Charset.forName("UTF-8");
//
//    private static final MimeType DEFAULT_CONTENT_TYPE = MimeType.valueOf("text/html");
//
//    public static final String DEFAULT_PREFIX = "classpath:/templates/";
//
//    public static final String DEFAULT_SUFFIX = ".html";

    /**
     * Check that the template exists before rendering it (Thymeleaf 3+).
     */
    private boolean checkTemplate = true;

    /**
     * Check that the templates location exists.
     */
    private boolean checkTemplateLocation = true;

    /**
     * 前缀设置，SpringBoot默认模板放置在classpath:/template/目录下
     */
    private String prefix;

    /**
     * 后缀设置，默认为.html
     */
    private String suffix;

    /**
     * 模板模式设置，默认为HTML5
     */
    private String mode;

    /**
     * 模板的编码设置，默认UTF-8
     */
    private Charset encoding;

    /**
     * 模板的媒体类型设置，默认为text/html
     */
    private MimeType contentType;

    /**
     * 是否开启模板缓存，默认是开启，开发时请关闭
     */
    private boolean cache;

    /**
     * Order of the template resolver in the chain. By default, the template resolver is
     * first in the chain. Order start at 1 and should only be set if you have defined
     * additional "TemplateResolver" beans.
     */
    private Integer templateResolverOrder;

    /**
     * Comma-separated list of view names that can be resolved.
     */
    private String[] viewNames;

    /**
     * Comma-separated list of view names that should be excluded from resolution.
     */
    private String[] excludedViewNames;

    /**
     * Enable MVC Thymeleaf view resolution.
     */
    private boolean enabled = true;
}
